package com.yq.spbYq.service.impl;

import com.yq.spbYq.Points;
import com.yq.spbYq.mapper.PointsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PointsService {

    @Autowired
    private PointsMapper pointsMapper;

    public List<Points> getAllPoints() {
        return pointsMapper.selectAllPoints();
    }

    public Points getPointsByResidentId(Integer residentId) {
        return pointsMapper.selectPointsByResidentId(residentId);
    }

    public int addPoints(Points points) {
        return pointsMapper.insertPoints(points);
    }

    public int updatePoints(Points points) {
        return pointsMapper.updatePointsByResidentId(points);
    }

    public int deletePointsByResidentId(Integer residentId) {
        return pointsMapper.deletePointsByResidentId(residentId);
    }
}